package com.base.cn.platform.os.service.manage.op.groom;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 推荐数据
 * @author ll
 * @date 2018/5/18 15:50
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface OpGroomDataService extends BaseService {


    /**
     * 批量添加推荐
     * @param dataIds 推荐数据Id
     * @param dataType 推荐类型
     * @param placeIds 推荐位置Id
     * @return
     */
    @RequestMapping(contextPath + "/op/savePlaceDataBatch")
    Map<String,Object> savePlaceDataBatch(@RequestParam("dataIds") String dataIds,
                                          @RequestParam("dataType") String dataType,
                                          @RequestParam("placeIds") String placeIds);


    /**
     * 单个推荐位置添加推荐数据
     * @param dataIds
     * @param dataType
     * @param placeKey
     * @param groomNum
     * @return
     */
    @RequestMapping(contextPath + "/op/saveUpdateOpGroomData")
    Map<String,Object> saveUpdateOpGroomData(@RequestParam("dataIds") String dataIds,
                                             @RequestParam("dataType") String dataType,
                                             @RequestParam("placeKey") String placeKey,
                                             @RequestParam("groomNum") Integer groomNum, @RequestParam("dataSorts") String dataSorts);

    /**
     * 清空推荐位置
     * @param dataType  推荐类型
     * @param placeKey  推荐Key
     * @return
     */
    @RequestMapping(contextPath + "/op/deleteGroomData")
    Map<String,Object> deleteGroomData(@RequestParam("dataType") String dataType,
                                       @RequestParam("placeKey") String placeKey);

    /**
     * 查询推荐位置
     * @param groomData 推荐内容实体
     */
    @RequestMapping(contextPath + "/op/queryGroomDataList")
    List<Map<String,Object>> queryGroomDataList(@RequestBody Map<String, Object> groomData);

    /**
     * 删除推荐数据，通过数据ID串和数据类型
     * @param dataIds 数据ID
     * @param dataType 数据类型
     */
    @RequestMapping(contextPath + "/op/deleteGroomDataByDataIdAndDataType")
    void deleteGroomDataByDataIdAndDataType(@RequestParam("dataIds") String dataIds,
                                            @RequestParam("dataType") String dataType);

    /**
     * 获取H5、App首页课程数据推荐
     * @param placeKey 推荐位置KEY
     * @return List<OpGroomData>
     */
    @RequestMapping(contextPath + "/op/findAppH5IndexGroomData")
    List<Map<String,Object>>  findAppH5IndexGroomData(@RequestParam("placeKey") String placeKey);

}
